#lang racket/base
(provide
 prop:toplevel-definition
 toplevel-definition?
 toplevel-definition-binding?)

(define-values [prop:toplevel-definition
                toplevel-definition?
                toplevel-definition-ref]
  (make-struct-type-property 'toplevel-definition))

;; id -> boolean
(define (toplevel-definition-binding? id #:ctx [ctx* '()])
  (toplevel-definition?
   (syntax-local-value id (λ () #f) ctx*)))
